package com.daka.vo.response;

import com.daka.entity.Goods;
import lombok.Data;
import lombok.ToString;

/**
 * Created by yangx
 * CreateTime: 2017/1/3 12:52
 */

@Data
@ToString
public class GoodsVo extends Goods {
    private String maxUserStr;

    private Integer payStatus;

    public static GoodsVo build(Goods goods) {
        GoodsVo goodsVo = new GoodsVo();
        goodsVo.setId(goods.getId());
        goodsVo.setType(goods.getType());
        goodsVo.setCode(goods.getCode());
        goodsVo.setName(goods.getName());
        goodsVo.setIndexImg(goods.getIndexImg());
        goodsVo.setImg(goods.getImg());
        goodsVo.setDemo(goods.getDemo());
        goodsVo.setSourceUser(goods.getSourceUser());
        goodsVo.setSourceTeam(goods.getSourceTeam());
        goodsVo.setStartAmount(goods.getStartAmount());
        goodsVo.setMaxAmount(goods.getMaxAmount());
        goodsVo.setMaxUser(goods.getId());
        goodsVo.setMaxTeam(goods.getMaxTeam());
        goodsVo.setCreateTime(goods.getCreateTime());
        goodsVo.setUpdateTime(goods.getUpdateTime());
        return goodsVo;
    }

    public static GoodsVo build(Goods goods,Integer payStatus) {
        GoodsVo goodsVo = new GoodsVo();
        goodsVo.setId(goods.getId());
        goodsVo.setType(goods.getType());
        goodsVo.setCode(goods.getCode());
        goodsVo.setName(goods.getName());
        goodsVo.setIndexImg(goods.getIndexImg());
        goodsVo.setImg(goods.getImg());
        goodsVo.setDemo(goods.getDemo());
        goodsVo.setSourceUser(goods.getSourceUser());
        goodsVo.setSourceTeam(goods.getSourceTeam());
        goodsVo.setStartAmount(goods.getStartAmount());
        goodsVo.setMaxAmount(goods.getMaxAmount());
        goodsVo.setMaxUser(goods.getId());
        goodsVo.setMaxTeam(goods.getMaxTeam());
        goodsVo.setCreateTime(goods.getCreateTime());
        goodsVo.setUpdateTime(goods.getUpdateTime());
        goodsVo.setPayStatus(payStatus);
        return goodsVo;
    }
}
